home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global soundLevelSprite, APbutton, fileList, listOfLabels, themeList, firstAlert
- set fileList to [:]
- set listOfLabels to [:]
- set themeList to [:]
- set soundLevelSprite to 48
- set APbutton to 9
- set the volume of sound 1 to 255
- set the volume of sound 2 to 255
- set firstAlert to 1
- set the textHeight of field "readout" to 16
- set the textHeight of field "readout reset" to 16
- resetReadout()
- setListOfFiles()
- setLIstOfLabels()
- setListOfThemes()
- when keyDown then soundKeyControl
- if the optionDown then
- go("main")
- end if
- end
-
- on stopMovie
- resetReadout()
- when keyDown then nothing
- set the text of field "name of inactive choice" to " "
- end
-
- on setListOfFiles
- global fileList
- set fileList to [:]
- repeat with x = 1 to the number of lines in field "file name lookup list"
- addProp(fileList, item 1 of line x of field "file name lookup list", x)
- end repeat
- end
-
- on setLIstOfLabels
- global listOfLabels
- set listOfLabels to [:]
- set numOflabels to the number of lines in field "song labels"
- repeat with x = 7 to 6 + numOflabels
- addProp(listOfLabels, x, line x - 6 of field "song labels")
- end repeat
- end
-
- on setListOfThemes
- global themeList
- set themeList to [:]
- repeat with x = 1 to the number of lines in field "filenames of the 12 themes"
- addProp(themeList, x, item 1 of line x of field "filenames of the 12 themes")
- end repeat
- end
-
- on turnOffAllSprites
- repeat with x = 1 to 48
- set the puppet of sprite x to 0
- end repeat
- end
-
- on resetReadout whichTracks
- set the text of field "readout" to the text of field "readout reset"
- end
-
- on playArandomTheme
- global themeList
- set fileToPlay to getaProp(themeList, random(count(themeList)))
- if the machineType = 256 then
- set soundToPlay to fileToPlay & ".wav"
- sound playFile 1, fileToPlay
- else
- sound playFile 1, fileToPlay
- end if
- end
-
- on copyAlert
- alert("In the full version of Java Beat, this button copies the selected " & "audio segment to your hard drive.")
- end
-
- on showAnAlert
- global firstAlert
- if firstAlert then
- alert(the text of field "first Alert")
- set firstAlert to 0
- else
- alert(line random(the number of lines in field "alert list") of field "alert list")
- end if
- end
-
- on goToAnInctiveChoice soundToPlay
- global listOfLabels
- sound stop 1
- sound stop 2
- set the text of field "name of inactive choice" to the name of cast the castNum of sprite the clickOn
- set frameToGoTo to getaProp(listOfLabels, the clickOn)
- if the labelList contains frameToGoTo then
- go(frameToGoTo)
- else
- alert("handler goToAnInctiveChoice was unable to get the targeted label")
- end if
- if stringp(soundToPlay) then
- if the machineType = 256 then
- sound stop 1
- set soundToPlay to soundToPlay & ".wav"
- sound playFile 1, soundToPlay
- else
- sound stop 2
- set soundToPlay to soundToPlay
- sound playFile 2, soundToPlay
- end if
- end if
- end
-
- on returnFromAnInctiveChoice
- sound stop 1
- go("main")
- end
-
- on quitThisMovie
- global soundLevelSprite
- sound stop 1
- sound stop 2
- set the puppet of sprite soundLevelSprite to 0
- put "soundlevel sprite = " & soundLevelSprite && the puppet of sprite soundLevelSprite
- go("quitFrame")
- end
-
- on playSoundFromclickList
- global fileList
- set clickedLine to the mouseLine
- set fieldToUse to the name of cast the castNum of sprite the clickOn
- set soundDescription to line clickedLine of field fieldToUse
- sound stop 1
- sound stop 2
- hilite line clickedLine of field fieldToUse
- set fileNumber to getaProp(fileList, soundDescription)
- set fileName to item 2 of line fileNumber of field "file name lookup list"
- set fileRate to item 3 of line fileNumber of field "file name lookup list"
- set fileLength to item 4 of line fileNumber of field "file name lookup list"
- if the machineType = 256 then
- set fileName to fileName & ".WAV"
- end if
- set soundToPlay to fileName
- sound playFile 2, soundToPlay
- put fileName into line 1 of newReadout
- put fileRate into line 2 of newReadout
- put " " & fileLength into word 2 of line 2 of newReadout
- put newReadout into field "readOut"
- end
-
- on soundKeyControl
- if the key = 0 then
- setSoundLevelMeter(0)
- else
- if (the key >= 1) and (the key <= 9) then
- setSoundLevelMeter(the key)
- end if
- end if
- dontPassEvent()
- end
-
- on setSoundLevelMeter whichLevel
- global userVolumeLevel, soundLevelSprite
- if whichLevel < 0 then
- set whichLevel to 0
- else
- if whichLevel > 9 then
- set whichLevel to 9
- end if
- end if
- set newSoundLevel to 28 * whichLevel
- set the volume of sound 1 to newSoundLevel
- set the volume of sound 2 to newSoundLevel
- set userVolumeLevel to newSoundLevel
- set soundlevelToShow to "sound level " & string(whichLevel)
- set the castNum of sprite soundLevelSprite to the number of cast soundlevelToShow
- updateStage()
- end
-
- on threeDbutton whereToGoOrWhatToDo
- set cOn to the clickOn
- set mouseDownTime to the timer
- set originalCastNum to the castNum of sprite cOn
- set newCastNum to the castNum of sprite cOn + 1
- set the puppet of sprite cOn to 1
- set the castNum of sprite cOn to newCastNum
- updateStage()
- set rollOn to 1
- repeat while the stillDown
- if rollOver(cOn) and not rollOn then
- set the castNum of sprite cOn to newCastNum
- updateStage()
- set rollOn to 1
- next repeat
- end if
- if not rollOver(cOn) and rollOn then
- set the castNum of sprite cOn to originalCastNum
- updateStage()
- set rollOn to 0
- end if
- end repeat
- repeat while (mouseDownTime + 10) > the timer
- nothing()
- end repeat
- if rollOn = 1 then
- set the castNum of sprite cOn to originalCastNum
- set the puppet of sprite cOn to 0
- updateStage()
- end if
- if rollOn and stringp(whereToGoOrWhatToDo) then
- if the labelList contains whereToGoOrWhatToDo then
- go(whereToGoOrWhatToDo)
- else
- do(whereToGoOrWhatToDo)
- end if
- end if
- end
-